package com.procurement.orders.mapper;

import java.util.List;

import com.procurement.orders.domain.PcmMaterialRecord;
import com.procurement.orders.domain.PcmPurchaseRequest;
import com.procurement.orders.domain.PcmApplicationDetail;
import com.ruoyi.system.api.domain.PcmAudit;
import org.apache.ibatis.annotations.Select;

/**
 * 采购申请Mapper接口
 * 
 * @author liyang
 * @date 2023-12-05
 */
public interface PcmPurchaseRequestMapper 
{
    /**
     * 查询采购申请
     * 
     * @param purchaseRequestNumber 采购申请主键
     * @return 采购申请
     */
    public PcmPurchaseRequest selectPcmPurchaseRequestByPurchaseRequestNumber(String purchaseRequestNumber);

    /**
     * 查询采购申请列表
     * 
     * @param pcmPurchaseRequest 采购申请
     * @return 采购申请集合
     */
    public List<PcmPurchaseRequest> selectPcmPurchaseRequestList(PcmPurchaseRequest pcmPurchaseRequest);

    /**
     * 新增采购申请
     * 
     * @param pcmPurchaseRequest 采购申请
     * @return 结果
     */
    public int insertPcmPurchaseRequest(PcmPurchaseRequest pcmPurchaseRequest);

    /**
     * 修改采购申请
     * 
     * @param pcmPurchaseRequest 采购申请
     * @return 结果
     */
    public int updatePcmPurchaseRequest(PcmPurchaseRequest pcmPurchaseRequest);

    /**
     * 删除采购申请
     * 
     * @param purchaseRequestNumber 采购申请主键
     * @return 结果
     */
    public int deletePcmPurchaseRequestByPurchaseRequestNumber(String purchaseRequestNumber);

    /**
     * 批量删除采购申请
     * 
     * @param purchaseRequestNumbers 需要删除的数据主键集合
     * @return 结果
     */
    public int deletePcmPurchaseRequestByPurchaseRequestNumbers(String[] purchaseRequestNumbers);

    /**
     * 批量删除申请明细
     * 
     * @param purchaseRequestNumbers 需要删除的数据主键集合
     * @return 结果
     */
    public int deletePcmApplicationDetailByPurchaseRequestIds(String[] purchaseRequestNumbers);
    
    /**
     * 批量新增申请明细
     * 
     * @param pcmApplicationDetailList 申请明细列表
     * @return 结果
     */
    public int batchPcmApplicationDetail(List<PcmApplicationDetail> pcmApplicationDetailList);
    

    /**
     * 通过采购申请主键删除申请明细信息
     * 
     * @param purchaseRequestNumber 采购申请ID
     * @return 结果
     */
    public int deletePcmApplicationDetailByPurchaseRequestId(String purchaseRequestNumber);


    /**
     * 物料信息
     *
     *
     * @return 结果
     */
    public List<PcmMaterialRecord> RecordList();

    @Select("select max(purchase_request_number) from pcm_purchase_request")
    String getMaxProductNumber();




    /**
     * 新增【请填写功能名称】
     *
     * @param pcmAudit 【请填写功能名称】
     * @return 结果
     */
    public int insertPcmAudit(PcmAudit pcmAudit);
}
